package com.training.commons;

import java.util.Calendar;
import java.util.Date;
import java.text.SimpleDateFormat;

public class SystemDate {

	public static String getCurrentDate() {
		// 获取日期
		String currentDate = new SimpleDateFormat("当前日期：yyyy年M月d日").format(new Date());

		//获取星期
		int day = Calendar.getInstance().get(Calendar.DAY_OF_WEEK) - 1;
		String week = "&nbsp;&nbsp;星期一";
		switch (day) {
		case 0:
			week = "&nbsp;&nbsp;星期天";
			break;
		case 1:
			week = "&nbsp;&nbsp;星期一";
			break;
		case 2:
			week = "&nbsp;&nbsp;星期二";
			break;
		case 3:
			week = "&nbsp;&nbsp;星期三";
			break;
		case 4:
			week = "&nbsp;&nbsp;星期四";
			break;
		case 5:
			week = "&nbsp;&nbsp;星期五";
			break;
		case 6:
			week = "&nbsp;&nbsp;星期六";
			break;
		}

		return currentDate + week;
	}
}
